<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>清除数据 - 密钥管理服务</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        body {
            background-color: #f3f4f6;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
        }
        .card {
            background-color: white;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
            padding: 2rem;
        }
        .btn {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-primary {
            background-color: #3b82f6;
            color: white;
        }
        .btn-primary:hover {
            background-color: #2563eb;
        }
        .btn-secondary {
            background-color: #e5e7eb;
            color: #374151;
        }
        .btn-secondary:hover {
            background-color: #d1d5db;
        }
    </style>
</head>
<body class="flex justify-center items-center min-h-screen">
    <div class="card max-w-md w-full">
        <h1 class="text-2xl font-bold mb-4 text-center">清除数据</h1>
        <p class="mb-6 text-center text-gray-600">此操作将清除所有模拟数据，页面将在重新加载时重新生成完整的模拟数据。</p>
        <div class="flex gap-4 justify-center">
            <button onclick="clearLocalStorage()" class="btn btn-primary px-6 py-2">清除数据</button>
            <button onclick="goBack()" class="btn btn-secondary px-6 py-2">返回主页面</button>
        </div>
    </div>

    <script>
        function clearLocalStorage() {
            localStorage.clear();
            alert('数据已清除！页面将在重新加载时重新生成模拟数据。');
            window.location.href = 'index.html';
        }

        function goBack() {
            window.location.href = 'index.html';
        }
    </script>
</body>
</html>